home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 24
/
AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
MT-RechnungIII
/
Rexx
/
WWRechÜber_NW2.inbrexx
< prev
next >
Wrap
Text File
|
1998-10-31
|
9KB
|
371 lines
/*
** Druck-, Vorschau, Sichern der Rechnungsübersicht Netto Währung1 mit Hilfe von WordWorth
** $VER: WWRechÜber_NW1.inbrexx V1.01 (01.11.98)
*/
PARSE ARG ARexxPort;
ADDRESS VALUE ARexxPort;
OPTIONS RESULTS;
WWVorlage = "WWDokumente/ERechübersicht_Netto.ww";
WWDokument = "t:ERechübersicht_Netto.ww";
WWPort = "WORDWORTH."
LF = '0a'x; /* Zeilenvorschub */
Gefunden = 0;
DO i = 1 TO 20 WHILE(Gefunden = 0)
IF show(ports, (WWPort || i)) THEN
DO;
Gefunden = 1;
WWPort = WWPort || i;
END;
END;
IF Gefunden = 0 THEN
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "WordWorth ist nicht aktiv, bitte starten sie dieses" || LF || "und versuchen Sie es erneut";
ES_GADGETFORMAT = "Abbrechen";
EASY_REQUEST;
EXIT;
END;
/* Original WW-Dokument nach t: kopieren, um ein versehentliches überschreiben */
/* dieser Vorlage zu verhindern */
GET_REXXPATH;
WWVorlage = MTR_RESULT || WWVorlage;
ADDRESS COMMAND "copy" WWVorlage WWDokument;
/* Oberfläche sperren */
LOCKGUI;
/* Art ermitteln: 0 = Drucken, 1 = Vorschau, 2 = Speichern */
PRINTSTATE;
Druckart = MTR_RESULT;
Ende_Kennzeichen = 'N';
/* Suchen der zu druckenden Daten */
GET_PREFS;
PRINTFIND;
/* Neues Dokument öffnen */
ADDRESS VALUE WWPort;
NEW;
WWPort = RESULT;
IF (MTR_RESULT > 0 & Ende_Kennzeichen = 'N') THEN
DO;
CALL DatenAufbereiten;
SELECT;
WHEN Druckart = 0 THEN /* Drucken */
DO;
ADDRESS VALUE WWPort;
PRINT;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
WHEN Druckart = 1 THEN /* Vorschau */
ADDRESS VALUE ARexxPort;
WHEN Druckart = 2 THEN /* Sichern */
DO;
ADDRESS VALUE WWPort;
SAVEAS;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
OTHERWISE
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "Druckart wird nicht unterstützt!";
ES_GADGETFORMAT = "Ok";
EASY_REQUEST;
Ende_Kennzeichen = 'J';
END;
END;
END;
/* WordWorth-Datei aus t: wieder entfernen */
ADDRESS COMMAND "delete" WWDokument;
/* Oberfläche wieder entsperren */
ADDRESS VALUE ARexxPort;
FREEGUI;
EXIT;
DatenAufbereiten:
w = 2;
wm = 1;
Gesamtsumme.0 = 0;
Gesamtsumme.1 = 0;
MWStSumme.0.0 = 0;
MWStSumme.0.1 = 0;
MWStSumme.1.0 = 0;
MWStSumme.1.1 = 0;
MWStSumme.2.0 = 0;
MWStSumme.2.1 = 0;
MWStSumme.3.0 = 0;
MWStSumme.3.1 = 0;
MWStSumme.4.0 = 0;
MWStSumme.4.1 = 0;
MWStSumme.5.0 = 0;
MWStSumme.5.1 = 0;
MWStSumme.6.0 = 0;
MWStSumme.6.1 = 0;
MWStSumme.7.0 = 0;
MWStSumme.7.1 = 0;
MWStSumme.8.0 = 0;
MWStSumme.8.1 = 0;
MWStSumme.9.0 = 0;
MWStSumme.9.1 = 0;
MWStSatz.0 = 0;
MWStSatz.1 = 0;
MWStSatz.2 = 0;
MWStSatz.3 = 0;
MWStSatz.4 = 0;
MWStSatz.5 = 0;
MWStSatz.6 = 0;
MWStSatz.7 = 0;
MWStSatz.8 = 0;
MWStSatz.9 = 0;
ADDRESS VALUE WWPort;
OPEN FILENAME WWDokument FORCE;
POSITION SOF;
DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
ADDRESS VALUE ARexxPort;
IF IB.BILL_NUMBER > "" THEN
ZW_Nummer = LEFT(IB.BILL_NUMBER, 20);
ELSE
DO;
IF PREFS.NUMBER_DIGITS > 0 THEN
ZW_Nummer = LEFT(RIGHT( (Copies("0",PREFS.NUMBER_DIGITS) || MTR_RESULT), PREFS.NUMBER_DIGITS ), 20);
ELSE
ZW_Nummer = LEFT(MTR_RESULT, 20);
END;
FORMAT_DATE_LONG IB.DATE_PAYED;
ZW_Datum = LEFT(MTR_RESULT, 35);
IF PREFS.NUMBER_DIGITS > 0 THEN
ZW_Lieferant = RIGHT( (Copies("0",PREFS.NUMBER_DIGITS) || IB.INVOICEE_NUMBER), PREFS.NUMBER_DIGITS );
ELSE
ZW_Lieferant = IB.INVOICEE_NUMBER;
IF PREFS.NUMBER_DIGITS > 0 THEN
ZW_Besteller = RIGHT( (Copies("0",PREFS.NUMBER_DIGITS) || IB.ORDERER_NUMBER), PREFS.NUMBER_DIGITS );
ELSE
ZW_Besteller = IB.ORDERER_NUMBER;
ADDRESS VALUE WWPort;
TEXT (ZW_Nummer || " " || ZW_Datum || " " || ZW_Lieferant || " " || ZW_Besteller);
NEWPARAGRAPH;
DO i = 1 to IB.COUNT_ARTICLE;
ADDRESS VALUE ARexxPort;
FORMAT_NUMBER IB.i.POS_QUANTITY PREFS.FRAC_DIGITS;
ZW_Anzahl = MTR_RESULT;
NAME_OF_QUANTITY_UNIT IB.i.ARTICLE.QUANTITY_UNIT;
ZW_Einheit = MTR_RESULT;
j = IB.i.POS_VALUE;
FORMAT_NUMBER IB.VALUE_PERCENT.j PREFS.FRAC_DIGITS_PERCENT;
ZW_MWSt = RIGHT(MTR_RESULT, 10);
IF w < 2 THEN
FORMAT_MONEY1 IB.i.POS_SINGLE_PRICE.w;
ELSE
FORMAT_MONEY2 IB.i.POS_SINGLE_PRICE.w;
ZW_EinzelPreis = MTR_RESULT;
ADDRESS VALUE WWPort;
TEXT (" " || IB.i.POS_ARTICLE_NUMBER_FORMATED || " " || ZW_Anzahl || " " || ZW_Einheit || " " || ZW_MWSt || " " || ZW_EinzelPreis);
DO i2 = 0 TO 2;
IF IB.i.POS_ADD_RED_USED.i2 > 0 THEN
DO;
ADDRESS VALUE ARexxPort;
j2 = IB.i.POS_ADD_RED_USED.i2 - 1;
IF IB.i.POS_ADD_RED_TYPE.i2 = 0 | IB.i.POS_ADD_RED_TYPE.i2 = 5 THEN
DO;
FORMAT_NUMBER IB.i.POS_ADD_RED_VALUE.i2.w PREFS.FRAC_DIGITS_PERCENT;
END;
ELSE
DO;
IF w < 2 THEN
FORMAT_MONEY1 IB.i.POS_ADD_RED_VALUE.i2.w;
ELSE
FORMAT_MONEY2 IB.i.POS_ADD_RED_VALUE.i2.w;
END;
ZW_EinzelPreis = RIGHT(MTR_RESULT, 15);
IF w < 2 THEN
FORMAT_MONEY1 IB.i.POS_ADD_RED_VALUE_POS.i2.w;
ELSE
FORMAT_MONEY2 IB.i.POS_ADD_RED_VALUE_POS.i2.w;
ZW_PosPreis = RIGHT(MTR_RESULT, 18);
ADDRESS VALUE WWPort;
NEWPARAGRAPH;
TEXT " " || PREFS.ADD_RED_TEXT.j2 || " " || ZW_EinzelPreis || " " || ZW_PosPreis;
END;
END;
ADDRESS VALUE ARexxPort;
IF w < 2 THEN
FORMAT_MONEY1 IB.i.POS_SUM_M_ALL.w;
ELSE
FORMAT_MONEY2 IB.i.POS_SUM_M_ALL.w;
ZW_PosPreis = MTR_RESULT;
ADDRESS VALUE WWPort;
TEXT " " || ZW_PosPreis;
NEWPARAGRAPH;
END;
DO i = 0 to 2;
IF IB.ADD_RED_USED.i > 0 THEN
DO;
ADDRESS VALUE ARexxPort;
j2 = IB.ADD_RED_USED.i - 1;
IF IB.ADD_RED_TYPE.i = 0 | IB.ADD_RED_TYPE.i = 5 THEN
DO;
FORMAT_NUMBER IB.ADD_RED_VALUE.i.w PREFS.FRAC_DIGITS_PERCENT;
END;
ELSE
DO;
IF w < 2 THEN
FORMAT_MONEY1 IB.ADD_RED_VALUE.i.w;
ELSE
FORMAT_MONEY2 IB.ADD_RED_VALUE.i.w;
END;
ZW_EinzelPreis = RIGHT(MTR_RESULT, 16);
IF w < 2 THEN
FORMAT_MONEY1 IB.ADD_RED_VALUE_POS.i.w;
ELSE
FORMAT_MONEY2 IB.ADD_RED_VALUE_POS.i.w;
ZW_PosPreis = RIGHT(MTR_RESULT, 16);
ADDRESS VALUE WWPort;
TEXT " " || PREFS.ADD_RED_TEXT.j2 || " " || ZW_EinzelPreis || " " || ZW_PosPreis;
NEWPARAGRAPH;
END;
END;
IF IB.DISPATCH_COSTS.w > 0 THEN
DO;
ADDRESS VALUE ARexxPort;
IF w < 2 THEN
FORMAT_MONEY1 IB.DISPATCH_COSTS.w;
ELSE
FORMAT_MONEY2 IB.DISPATCH_COSTS.w;
ZW_Betrag = MTR_RESULT;
ADDRESS VALUE WWPort;
TEXT (" Versandkosten: " ZW_Betrag);
NEWPARAGRAPH;
END;
ADDRESS VALUE ARexxPort;
IF w < 2 THEN
FORMAT_MONEY1 IB.TOTAL_M_ALL_CH.w;
ELSE
FORMAT_MONEY2 IB.TOTAL_M_ALL_CH.w;
ZW_Betrag = MTR_RESULT;
ADDRESS VALUE WWPort;
TEXT (" Rechnungsendbetrag: " ZW_Betrag);
NEWPARAGRAPH;
NEWPARAGRAPH;
IF w < 2 THEN
DO;
Gesamtsumme.0 = Gesamtsumme.0 + IB.TOTAL_M_ALL_CH.0;
Gesamtsumme.1 = Gesamtsumme.1 + IB.TOTAL_M_ALL_CH.1;
DO i = 0 TO 9;
MWStSatz.i = IB.VALUE_PERCENT.i
MWStSumme.i.0 = MWStSumme.i.0 + IB.SUM_PER_VALUE_M_ALL_CH.i.0;
MWStSumme.i.1 = MWStSumme.i.1 + IB.SUM_PER_VALUE_M_ALL_CH.i.1;
END;
END;
ELSE
DO;
Gesamtsumme.0 = Gesamtsumme.0 + IB.TOTAL_M_ALL_CH.2;
Gesamtsumme.1 = Gesamtsumme.1 + IB.TOTAL_M_ALL_CH.3;
DO i = 0 TO 9;
MWStSatz.i = IB.VALUE_PERCENT.i
MWStSumme.i.0 = MWStSumme.i.0 + IB.SUM_PER_VALUE_M_ALL_CH.i.2;
MWStSumme.i.1 = MWStSumme.i.1 + IB.SUM_PER_VALUE_M_ALL_CH.i.3;
END;
END;
ADDRESS VALUE ARexxPort;
PRINTFIND;
END;
ADDRESS VALUE ARexxPort;
IF w < 2 THEN
FORMAT_MONEY1 Gesamtsumme.0;
ELSE
FORMAT_MONEY2 Gesamtsumme.0;
ZW_Gesamtsumme_Netto = MTR_RESULT;
j = 0;
DO i = 0 TO 9;
IF MWStSumme.i.0 > 0 THEN
DO;
FORMAT_NUMBER MWStSatz.i PREFS.FRAC_DIGITS_PERCENT;
j = j + 1;
ZW_MWSt_TXT.j = "Mehrwertsteuer (" || MTR_RESULT || "%, Netto: ";
IF w < 2 THEN
FORMAT_MONEY1 MWStSumme.i.0;
ELSE
FORMAT_MONEY2 MWStSumme.i.0;
ZW_MWSt_TXT.j = ZW_MWSt_TXT.j || MTR_RESULT || ", Brutto: ";
IF w < 2 THEN
FORMAT_MONEY1 MWStSumme.i.1;